package xin.baizhiedu.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ws.schild.jave.EncoderException;
import xin.baizhiedu.entity.AppFileLoad;
import xin.baizhiedu.mapper.AppFileUploadMapper;

import java.net.MalformedURLException;
import java.util.List;

import static xin.baizhiedu.Util.VoiceUtil.acceptWaveForm;

@Controller
public class IndexController {
    @Autowired
    AppFileUploadMapper appFileUploadMapper;
    @RequestMapping("/")
    public String index() {
        return "index";
    }

    @RequestMapping("/upload_app")
    public String upload(ModelMap model) {
        QueryWrapper<AppFileLoad> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("VERSIONNUMBER");
        List<AppFileLoad>  appFileLoadList=  appFileUploadMapper.selectList(wrapper);
        model.put("appFileLoadList",appFileLoadList);
        return "upload";
    }



}
